﻿@using Microsoft.AspNetCore.Html;

@{
    ViewData["Title"] = "Home Page";

    string result = ViewData["JsonData"] == null ? string.Empty : ViewData["JsonData"].ToString();
    var resultHtml = new HtmlString(result);
}
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/js/jsonHelper.js"></script>

<style type="text/css">
    .json-data {
        /*width: 600px;*/
        margin: 20px auto;
        text-align: center;
        background-color: #EFEFEF;
        border-radius: 10px;
        padding: 15px 15px 5px 15px;
    }

    pre {
        white-space: pre-wrap;
        word-wrap: break-word;
        text-align: left;
    }
</style>
<h3>查询的数据：</h3>
<div class="json-data">
    <pre></pre>
</div>
<script type="text/javascript">
    var jsonData = '@(resultHtml)';
    $('pre').html(jsonData);
    var value = formatJson(jsonData, function (res) {
        console.error(res);
        return;
    });
    $('pre').html(value);
</script>
